<html STYLE="width: 432px; height: 110px; ">
<head><title>Insert Flash</title><head>
<style>
  html, body, button, div, input, select, td, fieldset { font-family: MS Shell Dlg; font-size: 8pt; };
</style>
<script>

// if we pass the "window" object as a argument and then set opener to
// equal that we can refer to dialogWindows and popupWindows the same way
opener = window.dialogArguments;

var _editor_url = opener._editor_url;
var objname     = location.search.substring(1,location.search.length);

function _CloseOnEsc() {
  if (event.keyCode == 27) { window.close(); return; }
}

window.onerror = HandleError

function HandleError(message, url, line) {
  var str = "An error has occurred in this dialog." + "\n\n"
  + "Error: " + line + "\n" + message;
  alert(str);
//  window.close();
  return true;
}

function Init() {
  document.body.onkeypress = _CloseOnEsc;
}

function _isValidNumber(txtBox) {
  var val = parseInt(txtBox);
  if (isNaN(val) || val < 0) { return false; }
  return true;
}

function btnOKClick() {

  if (!txtFileName.value || txtFileName.value == "http://") { 
    alert("Flash URL must be specified.");
    txtFileName.focus();
    return;
  }
  if (!txtWidth.value || !_isValidNumber(txtWidth.value)) {
    alert("Flash width must be a number.");
    txtWidth.focus();
    return;
  }
  if (!txtHeight.value || !_isValidNumber(txtHeight.value)) {
    alert("Flash height must be a number.");
    txtHeight.focus();
    return;
  }

  // create flash
  var flash = '<div align=center><embed src="' + document.all.txtFileName.value + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + document.all.txtWidth.value + '" height="' + document.all.txtHeight.value + '" /></div>';

  // insert table
  opener.editor_insertHTML(objname, flash);

  // close popup window
  window.close();
}
</SCRIPT>
</HEAD>
<BODY id=bdy onLoad="Init()" style="background: threedface; color: windowtext; margin: 10px; BORDER-STYLE: none" scroll=no>

<table border=0 cellspacing=0 cellpadding=2>
 <tr>
  <td>Flash URL: &nbsp;</td>
  <td><input type="text" name="txtFileName" id="txtFileName" value="http://"  style="width: 250px" onFocus="select()" /></td>
 </tr>
 <tr>
   <td>Size:</td>
   <td>
   Width: <input type="text" name="txtWidth" id="txtWidth"  style="width: 40px" maxlength=4 value="" /> px
   <strong>x</strong>
   Height: <input type="text" name="txtHeight" id="txtHeight"  style="width: 40px" maxlength=4 value="" /> px
   </td>
 </tr>
</table>

<div style="left: 340px; top: 13px; position: absolute">
 <BUTTON style="width: 7em; height: 2.2em; margin: 0 0 3 0" type=submit onClick="btnOKClick()">OK</BUTTON><br>
 <BUTTON style="width: 7em; height: 2.2em; " type=reset onClick="window.close();">Cancel</BUTTON>
</div>

</BODY>
</HTML>